# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MerchantAPI.Reports_v1beta.Model.CompetitiveVisibilityBenchmarkView do
  @moduledoc """
  Fields available for query in `competitive_visibility_benchmark_view` table. [Competitive visibility](https://support.google.com/merchants/answer/11366442) report with the category benchmark. Values are only set for fields requested explicitly in the request's search query.

  ## Attributes

  *   `categoryBenchmarkVisibilityTrend` (*type:* `float()`, *default:* `nil`) - Change in visibility based on impressions with respect to the start of the selected time range (or first day with non-zero impressions) for a combined set of merchants with highest visibility approximating the market. Cannot be filtered on in the 'WHERE' clause.
  *   `date` (*type:* `GoogleApi.MerchantAPI.Reports_v1beta.Model.Date.t`, *default:* `nil`) - Date of this row. Required in the `SELECT` clause. A condition on `date` is required in the `WHERE` clause.
  *   `reportCategoryId` (*type:* `String.t`, *default:* `nil`) - Google product category ID to calculate the report for, represented in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436). Required in the `SELECT` clause. A condition on `report_category_id` is required in the `WHERE` clause.
  *   `reportCountryCode` (*type:* `String.t`, *default:* `nil`) - Country where impressions appeared. Required in the `SELECT` clause. A condition on `report_country_code` is required in the `WHERE` clause.
  *   `trafficSource` (*type:* `String.t`, *default:* `nil`) - Traffic source of impressions. Required in the `SELECT` clause.
  *   `yourDomainVisibilityTrend` (*type:* `float()`, *default:* `nil`) - Change in visibility based on impressions for your domain with respect to the start of the selected time range (or first day with non-zero impressions). Cannot be filtered on in the 'WHERE' clause.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :categoryBenchmarkVisibilityTrend => float() | nil,
          :date => GoogleApi.MerchantAPI.Reports_v1beta.Model.Date.t() | nil,
          :reportCategoryId => String.t() | nil,
          :reportCountryCode => String.t() | nil,
          :trafficSource => String.t() | nil,
          :yourDomainVisibilityTrend => float() | nil
        }

  field(:categoryBenchmarkVisibilityTrend)
  field(:date, as: GoogleApi.MerchantAPI.Reports_v1beta.Model.Date)
  field(:reportCategoryId)
  field(:reportCountryCode)
  field(:trafficSource)
  field(:yourDomainVisibilityTrend)
end

defimpl Poison.Decoder,
  for: GoogleApi.MerchantAPI.Reports_v1beta.Model.CompetitiveVisibilityBenchmarkView do
  def decode(value, options) do
    GoogleApi.MerchantAPI.Reports_v1beta.Model.CompetitiveVisibilityBenchmarkView.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.MerchantAPI.Reports_v1beta.Model.CompetitiveVisibilityBenchmarkView do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
